#include <iostream>

int main() {
  std::cout << "Compiler: ";

// GCC 和 Clang
#ifdef __clang__
  std::cout << "Clang version: " << __clang_version__ << std::endl;
#elif defined(__GNUC__)
  std::cout << "GCC version: " << __GNUC__ << "." << __GNUC_MINOR__ << "."
            << __GNUC_PATCHLEVEL__ << std::endl;
#else
  std::cout << "Unknown Compiler" << std::endl;
#endif
  std::cout << "C++ Standard Version: ";

// 检查 C++14
#if defined(__cplusplus) && __cplusplus == 201402L
  std::cout << "C++14" << std::endl;

// 检查 C++17
#elif defined(__cplusplus) && __cplusplus == 201703L
  std::cout << "C++17" << std::endl;

// 检查 C++20
#elif defined(__cplusplus) && __cplusplus == 202002L
  std::cout << "C++20" << std::endl;

// 检查其他标准版本
#else
  std::cout << "Unknown C++ Version" << std::endl;
#endif
  return 0;
}
